package pe.gob.sunat.georeferencia.model.dao.ibatis;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import pe.gob.sunat.georeferencia.model.dao.MaestroZonaAlteDAO;
import pe.gob.sunat.georeferencia.model.domain.MaestroZonaAlte;
import pe.gob.sunat.georeferencia.model.domain.MaestroZonaAlteCriteria;

public class MaestroZonaAlteDAOImpl extends SqlMapClientDaoSupport implements MaestroZonaAlteDAO {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public MaestroZonaAlteDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public int countByExample(MaestroZonaAlteCriteria example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("t0006maes_zona_alte.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public int deleteByExample(MaestroZonaAlteCriteria example) {
        int rows = getSqlMapClientTemplate().delete("t0006maes_zona_alte.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public int deleteByPrimaryKey(String codZona) {
        MaestroZonaAlte key = new MaestroZonaAlte();
        key.setCodZona(codZona);
        int rows = getSqlMapClientTemplate().delete("t0006maes_zona_alte.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public void insert(MaestroZonaAlte record) {
        getSqlMapClientTemplate().insert("t0006maes_zona_alte.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public void insertSelective(MaestroZonaAlte record) {
        getSqlMapClientTemplate().insert("t0006maes_zona_alte.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    @SuppressWarnings("unchecked")
    public List<MaestroZonaAlte> selectByExample(MaestroZonaAlteCriteria example) {
        List<MaestroZonaAlte> list = getSqlMapClientTemplate().queryForList("t0006maes_zona_alte.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public MaestroZonaAlte selectByPrimaryKey(String codZona) {
        MaestroZonaAlte key = new MaestroZonaAlte();
        key.setCodZona(codZona);
        MaestroZonaAlte record = (MaestroZonaAlte) getSqlMapClientTemplate().queryForObject("t0006maes_zona_alte.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public int updateByExampleSelective(MaestroZonaAlte record, MaestroZonaAlteCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("t0006maes_zona_alte.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public int updateByExample(MaestroZonaAlte record, MaestroZonaAlteCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("t0006maes_zona_alte.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public int updateByPrimaryKeySelective(MaestroZonaAlte record) {
        int rows = getSqlMapClientTemplate().update("t0006maes_zona_alte.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    public int updateByPrimaryKey(MaestroZonaAlte record) {
        int rows = getSqlMapClientTemplate().update("t0006maes_zona_alte.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table t0006maes_zona_alte
     *
     * @ibatorgenerated
     */
    private static class UpdateByExampleParms extends MaestroZonaAlteCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, MaestroZonaAlteCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}